<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<html>
<head>
<meta name="decorator" content="front" />
<title>景区直通车</title>
<link href="${ctxStatic }/xiake/css/list.css" rel='stylesheet'type='text/css' />
<link href="${ctxStatic }/xiake/css/data.css" rel='stylesheet'type='text/css' />
<link href="${ctxStatic }/cityselector/cityselect.css" rel='stylesheet'type='text/css' />
<script type="text/javascript" src="${ctxStatic }/cityselector/cityselect.js"></script>
<script type="text/javascript">
	$(function() {
		// 初始化站点选择框
		$.post('${ctxFront}/info/site/siteJson',{spottypes:'0,2'}, function(data) {
			var allCity = data;//['北京市#001#1|beijing|bj','上海市#002#0|shanghai|sh'];
			new Vcity.CitySelector({input:'boardaddrName',cityData:allCity});
			new Vcity.CitySelector({input:'offaddrName',cityData:allCity});
		});
		
		<%--// 单程的时候屏蔽掉返回日期
		$('input[name=type]').click(function(){
			if($(this).val()=='one') {
				$('#backDepartdateStr').attr('disabled','disabled');
			} else {
				$('#backDepartdateStr').removeAttr('disabled');
			}
		});
		$('input[name=type]:checked').click();--%>
		
		// 时间段改变后立即搜索
		$('input[name=boardtime]').change(function(){
			$('#searchForm').submit();
		});
		
		// 清除时间段查询条件
		$('#clearTimeBtn').on('click',function(){
			$('input[name=boardtime]:checked').removeAttr('checked');
			$('#searchForm').submit();
		});
	});
	// 点击日期范围中的日期后触发
	function changeDate(date){
		$('#departdateStr').val(date);
		$('#searchForm').submit();
	}
	
</script>
</head>
<body>
	<input type="hidden" id="menuInfo" value="indexRealsche">
	<div class="container">
		<div class="container_nav font_normal_size">
			<a href="${ctxFront}/index">霞客约车</a>&gt;<span class="main_color">景区直通车</span>
		</div>
		<form id="searchForm" action="${ctxFront}/realsche/list" method="get">
			<%-- 隐藏值区域 --%>
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" /> 
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
			<input type="hidden" name="schetype" value="${realsche.schetype}" />
			<div class="container_type font_normal_size">
				<label>出发地</label>
				<input type="text" id="boardaddrName" class="container_type_rzbc" name="boardaddrName" value="${realsche.boardaddrName}" placeholder="请输入出发地" autocomplete="off">
				<input type="hidden" name="boardaddr" value="${realsche.boardaddr}">
				<label>出发日期</label> 
				<input type="text" id="departdateStr" class="container_type_rq Wdate" name="departdateStr" maxlength="20" readonly class="fWdate" value="${realsche.departdateStr }" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,minDate:'${today}'});" />
				<label>目的地</label> 
				<input type="text" id="offaddrName" class="container_type_rzbc" name="offaddrName" value="${realsche.offaddrName}" placeholder="请输入目的地" autocomplete="off">
				<input type="hidden" name="offaddr" value="${realsche.offaddr}">
				<%-- <label>返回日期</label> 
				<input type="text" id="backDepartdateStr" class="container_type_rq Wdate" name="backDepartdateStr" maxlength="20" readonly class="fWdate" value="${realsche.departdateStr }" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,minDate:'${today}'});" /> --%>
				<div class="container_type_z pointer" onclick="$('#searchForm').submit();">查询</div>
			</div>
			<%--
			|==========================|
			|	日期范围搜索条件
			|==========================|
			--%>
			<div id="page">
				<div  class="content clearfix">
					<div id="prev" <c:if test="${not empty dayListPrev }">onclick="changeDate('${dayListPrev }');"</c:if>></div>
					<div id="timeline">
						<ul id="dates">
							<c:forEach items="${dayList }" var="day">
								<li class="${day.checked} ${day.old} ${day.normal}" ><a href="javascript:;" <c:if test="${empty day.old }">onclick="changeDate('${day.ymd }');"</c:if> >${day.md }<br>${day.week }</a></li>
							</c:forEach>
						</ul>
					</div>
					<div id="next" onclick="changeDate('${dayListNext }');"></div>
				</div>
			</div>
			<%--
			|==========================|
			|	时间段搜索条件
			|==========================|
			--%>
			<div class="decorator_time font_normal_size">
				<div><span style="margin: 10px 0 0 5px;font-weight: 600;display: inline-block;">${realsche.boardaddrName}-${realsche.offaddrName}</span></div>
				<span>出发时段</span>
				<button id="clearTimeBtn" type="button">不限</button>
				<input type="radio" name="boardtime" value="6-12" ${realsche.boardtime eq '6-12'?'checked':'' }/><span>06:00-12:00</span>
				<input type="radio" name="boardtime" value="12-18" ${realsche.boardtime eq '12-18'?'checked':'' }/><span>12:00-18:00</span>
				<input type="radio" name="boardtime" value="18-24" ${realsche.boardtime eq '18-24'?'checked':'' }/><span>18:00-24:00</span>
				<input type="radio" name="boardtime" value="0-6" ${realsche.boardtime eq '0-6'?'checked':'' }/><span>00:00-06:00</span>
			</div>
		</form>
		<div class="decorator_table font_normal_size">
			<table>
				<tr valign="middle">
					<!-- <th>发车日期</th> -->
					<th>出发时间</th>
					<th>出发—到达站</th>
					<th>含服务/往返票</th>
					<th>价格</th>
					<th>可预订数</th>
					<th>操作</th>
				</tr>
				<c:forEach items="${page.list}" var="realsche2">
					<tr>
						<td style="font-weight: 600;"><fmt:formatDate value="${realsche2.realboardtime }" pattern="HH:mm"/></td>
						<td style="width: 200px;"><div style="text-align: left; margin: 0 auto;width: 160px;">${realsche2.boardaddr}<br/>${realsche2.offaddr}</div></td>
						<td style="width: 400px;"><div style="text-align: left; margin: 0 auto;width: 320px;">
						<%-- <c:choose>
							<c:when test="${fn:contains(realsche2.schename, '豪华房车')}">
								<span style="font-weight: 600;">豪华房车</span><br/>
							</c:when>
							<c:otherwise>
								<span style="font-weight: 600;">豪华大巴</span><br/>
							</c:otherwise>
						</c:choose> --%>
						<c:if test="${realsche2.schetype == 2 }">
							<p>
								<span style="font-weight: 600;">往返票</span>
								${realsche2.diffdays==0?'当日':'' }
								${realsche2.diffdays==1?'次日':'' }
								${realsche2.diffdays==2?'后日':'' }
								${realsche2.diffdays==3?'第四日':'' }
								${realsche2.gathertime }从${realsche2.offaddr}返回
							</p>
						</c:if>
						
						<c:if test="${not empty realsche2.specserv}">
							<p>${realsche2.specserv }</p>
						</c:if>
						</div></td>
						<td>${realsche2.retailprice}</td>
						<td>${realsche2.leftSeats}</td>
						<td>
							<div class="decorator_table_c">
								<a href="${ctxFront}/realsche/details?realscheid=${realsche2.realscheid}&realboardid=${realsche2.realboardid }&realoffid=${realsche2.realoffid }&departdateStr=${realsche.departdateStr }&boardaddrfc=${boardaddrfc}&offaddrfc=${offaddrfc}&ordertype=${TORDERS_ORDER_TYPE_REALSCHE_SELF_TRAVEL }">
									预定
								</a>
							</div>
						</td>
					</tr>
				</c:forEach>
			</table>
			<div style="text-align: center;">
				<div class="pagination  font_normal_size" >${page.html}</div>
			</div>
			<div class="clear"></div>
		</div>
	</div>
</body>
</html>